namespace Logic.Map.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class altertablegudaoway : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.GudaoCar", "PassOper_F_Id", c => c.String(maxLength: 128));
            AddColumn("dbo.GudaoCar", "QiPiaoOper_F_Id", c => c.String(maxLength: 128));
            AddColumn("dbo.OperationGudaoCar", "FaHuoYuan_F_Id", c => c.String(maxLength: 50));
            AlterColumn("dbo.Pathway", "Length", c => c.Decimal(precision: 24, scale: 2));
            AlterColumn("dbo.HistoryGudaoCar", "ArriveDateTime", c => c.DateTime());
            CreateIndex("dbo.GudaoCar", "PassOper_F_Id");
            CreateIndex("dbo.GudaoCar", "QiPiaoOper_F_Id");
            CreateIndex("dbo.OperationGudaoCar", "FaHuoYuan_F_Id");
            AddForeignKey("dbo.OperationGudaoCar", "FaHuoYuan_F_Id", "dbo.Sys_User", "F_Id");
            AddForeignKey("dbo.GudaoCar", "PassOper_F_Id", "dbo.OperationGudaoCar", "F_Id");
            AddForeignKey("dbo.GudaoCar", "QiPiaoOper_F_Id", "dbo.OperationGudaoCar", "F_Id");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.GudaoCar", "QiPiaoOper_F_Id", "dbo.OperationGudaoCar");
            DropForeignKey("dbo.GudaoCar", "PassOper_F_Id", "dbo.OperationGudaoCar");
            DropForeignKey("dbo.OperationGudaoCar", "FaHuoYuan_F_Id", "dbo.Sys_User");
            DropIndex("dbo.OperationGudaoCar", new[] { "FaHuoYuan_F_Id" });
            DropIndex("dbo.GudaoCar", new[] { "QiPiaoOper_F_Id" });
            DropIndex("dbo.GudaoCar", new[] { "PassOper_F_Id" });
            AlterColumn("dbo.HistoryGudaoCar", "ArriveDateTime", c => c.DateTime(nullable: false));
            AlterColumn("dbo.Pathway", "Length", c => c.Decimal(nullable: false, precision: 24, scale: 2));
            DropColumn("dbo.OperationGudaoCar", "FaHuoYuan_F_Id");
            DropColumn("dbo.GudaoCar", "QiPiaoOper_F_Id");
            DropColumn("dbo.GudaoCar", "PassOper_F_Id");
        }
    }
}
